home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / net / parnet-3.2 / extras / parpc / pcfiles / get.c next >
C/C++ Source or Header  |  1995-03-09  |  734b  |  31 lines

  1. /* GET.C: Testing receipt of large amount data (without use of interrupts)
  2.  * 1. On the PC, type: get
  3.  * 2. On the Amiga, type: machaddr 4
  4.  *                        dump 1 4
  5.  */
  6. #include <stdio.h>
  7. #include "pardev.h"
  8.  
  9. main(int argc,char **argv)
  10. {
  11. unsigned char buffer[4096+8];
  12. unsigned int Length;
  13. unsigned long count=0;
  14.  
  15.  ParAddress(1,0x03bc);
  16.  
  17.  printf("port: chksum: length:  Kb:\n");
  18.  while(1)
  19.  if (ParDataReady())
  20.  {
  21.   Length=ParRead(buffer,4096+8);
  22.   if (Length >0)
  23.   {
  24.     printf("%04x  %04x   %08x  ",buffer[0]*256+buffer[1],
  25.                                  buffer[2]*256+buffer[3],
  26.                                  buffer[4]*65536+buffer[5]*4096+buffer[6]*256+buffer[7]);
  27.    printf("%d\n",count/1024);count+=Length;
  28.   }
  29.  }
  30. }
  31.